package cn.dugt.hotel.service;

import cn.dugt.hotel.dao.UserDao;
import cn.dugt.hotel.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Service;

@Service
public class UserService {
    @Autowired
    private UserDao userDao;

    public String finduser( String username, String  password){
        return userDao.findByUsernameandPassword(username,password);
    }

    public String userlogin(String username,String password,int role){
        return userDao.findByUsernameandPasswordandRole(username,password,role);
    }
    public Integer addUser(User user){
        return  userDao.insertUser(user);
    }
    public String findusername(String username){
        return userDao.findUsername(username);
    }
}
